Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the logic of NewVersionTest #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PenghaiZhang
Copy link

  • handling the new alert when creating a new version of an

    item that is in moderation

  • refactoring code to reduce duplicated code

* handling the new alert when creating a new version of an

  item that is in moderation

* refactoring code to reduce duplicated code
Copy link
Contributor

@SammyIsConfused SammyIsConfused left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few minor changes. 👍

itemList = adminPage.results();
// Login as SimpleModerator and moderate the new version of this item at the first step.
logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD);
doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, "moderation step 1", itemFullName2,false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe create a constant for "moderation step 1" string, as it is used more than once. Probably step 2 as well, for consistency.

@TestInstitution("workflow")
public class NewVersionTest extends AbstractCleanupTest
{
private static final String BACKTICK_PASSWORD = "``````";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are all public static final String, the whitespaces between each line should be removed.

WizardPageTab wizard = new ContributePage(context).load().openWizard("Move to Live During Moderation");
String itemFullName = context.getFullName("item");
String itemFullName2 = itemFullName + " 2";
wizard.editbox(1, itemFullName);
wizard.save().submit();
saveItem(wizard,1,itemFullName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be space between the parameters.

Copy link
Member

@edalex-ian edalex-ian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of tweaks, then we should be done. 👍

logout();
}

private void doModeration(String username, String password, String stepName, String itemFullName, Boolean lastModeration) {
TaskListPage taskListPage = new TaskListPage(context).load();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

username and password are unused. Remove.

// Login as SimpleModerator and moderate the new version of this item at the first step.
logon(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD);
doModeration(FIRST_MODERATOR_USERNAME, BACKTICK_PASSWORD, STEP_NAME_ONE, itemFullName2,false);
// After moderation, check that the item has gone life after the first moderation step
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo:

has gone life

should be

has gone live

ModerationView tasksTab = modResults.moderate(itemFullName);
tasksTab.assignToMe();
tasksTab.accept();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this if/else the braces should follow the statement.

Shame we don't have formatting here yet, but we will once we merge this repo in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants